<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
header('Access-Control-Allow-Origin: *');
header('Access-Control-Max-Age: 1800');
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE');
header('Access-Control-Allow-Headers: Api-Auth,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-CSRF-TOKEN, X-Requested-With');
Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});
Route::rule('','Index/index');
Route::rule('falan','Index/falan');
Route::rule('fdata','Index/fdata');
Route::rule('cdata','Index/cdata');
Route::rule('company','Index/company');
Route::rule('volume','Index/volume');
Route::post('image','Upload/image');
Route::post('xlsx','Upload/xlsx');
Route::post('standard','Index/standard');
Route::post('cache','Index/set_get_cache');
Route::post('calculate_result','Index/calculate_result');
Route::group('api',function(){
    Route::rule('login','api.Index/login');
    Route::rule('register','api.Index/register');
    Route::rule('model','api.Index/model_list');
    Route::rule('material','api.Index/material_list');
    Route::rule('calculator_all','api.Index/calculator_all');
    Route::rule('price_image','api.Index/price_image');
    Route::group('goods',function(){
        Route::rule('list','list');
        Route::rule('material','material');
    })->prefix('api.Goods/');;
    Route::group('buy',function(){
        Route::rule('info','info');
        Route::rule('list','list');
        Route::rule('save','save');
    })->prefix('api.Buy/');
    Route::group('index',function(){
        Route::rule('user','user');
        Route::rule('cost','cost');
        Route::rule('blank','blank');
        Route::rule('message','message');
        Route::rule('product','product');
        Route::rule('material','material');
    })->prefix('api.Index/');
});
Route::group('admin',function (){
    Route::get('login','admin.Login/sign');
    Route::post('login','admin.Login/login');
    Route::rule('input','admin.Index/input');
    Route::rule('unlogin','admin.Login/unlogin');
    Route::rule('index/:name','admin.Index/index');
    Route::group('order',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save','save');
        Route::rule('adopt','adopt');
        Route::rule('refuse','refuse');
        Route::rule('create','create');
        Route::rule('delete','delete');
    })->prefix('admin.Order/');
    Route::group('company',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','delete');
    })->prefix('admin.Company/');
    Route::group('classify',function (){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::post('save/:id','save');
        Route::rule('delete/:id','delete');
    })->prefix('admin.Classify/');
    Route::group('user',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::post('save','save');
        Route::rule('delete','delete');
    })->prefix('admin.User/');
    Route::group('config',function(){
        Route::rule('list','list');
    })->prefix('admin.Config/');
    Route::group('standard',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save/:id','save');
        Route::rule('delete/:id','delete');
    })->prefix('admin.Standard/');
    Route::group('supplier',function (){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save/:supplier','save');
    })->prefix('admin.Supplier/');
    Route::group('material_quality',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save','save');
        Route::rule('delete/:id','delete');
    })->prefix('admin.MaterialQuality/');
    Route::group('material_price',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save','save');
        Route::rule('delete/:id','delete');
    })->prefix('admin.MaterialPrice/');
    Route::group('message',function (){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save','save');
        Route::rule('delete/:id','delete');
    })->prefix('admin.Message/');
    Route::group('processing_fee',function (){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save','save');
        Route::rule('delete/:id','delete');
    })->prefix('admin.ProcessingFee/');
    Route::group('goods',function(){
        Route::rule('list','list');
        Route::rule('info','info');
        Route::rule('save','save');
        Route::rule('delete','delete');
        Route::group('material',function(){
            Route::rule('list','material_list');
            Route::rule('save','material_save');
            Route::rule('delete','material_delete');
        });
        Route::group('product',function(){
            Route::rule('list','product_list');
            Route::rule('save','product_save');
            Route::rule('info','product_info');
            Route::rule('delete','product_delete');
        });
    })->prefix('admin.Goods/');
    Route::group('price',function (){
        Route::rule('info','info');
    })->prefix('admin.Price/');
    Route::group('my',function(){
        Route::rule('info','company');
        Route::rule('material_value','material_value');
    })->prefix('admin.Index/');
    Route::group('amount',function(){
        Route::rule('info','info');
    })->prefix('admin.Amount/');
});
Route::miss(function(){
    return "路径错误";
});